<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class GoEz_Cli</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class GoEz_Cli</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Cli 類別</p>
	<ul class="tags">
				<li><span class="field">author:</span> Patrick Fisher &lt;<a href="mailto:patrick@pwfisher.com">patrick@pwfisher.com</a>&gt;</li>
				<li><span class="field">copyright:</span> Copyright (c) 2008-2012 Wabow Information Inc. (http://www.wabow.com)</li>
				<li><span class="field">see:</span> <a href="http://pwfisher.com/nucleus/index.php?itemid=45">http://pwfisher.com/nucleus/index.php?itemid=45</a></li>
				<li><span class="field">license:</span> New</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Cli.php.html">/Cli.php</a> (line <span class="field">20</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
												<div class="var-title">
					static <span class="var-type">array</span>
					<a href="#$args" title="details" class="var-name">$args</a>
				</div>
																							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
												<div class="method-definition">
					static 						<span class="method-result">bool</span>
										<a href="#getBoolean" title="details" class="method-name">getBoolean</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$default</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
					static 						<span class="method-result">void</span>
										<a href="#parseArgs" title="details" class="method-name">parseArgs</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$argv</span>)
									</div>
								
																				</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$args" id="$args"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			static <span class="var-type">array</span>
			<span class="var-name">$args</span>
						(line <span class="line-number">27</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Arguments</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodgetBoolean" id="getBoolean"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">static method getBoolean</span> (line <span class="line-number">119</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">將對應的選項轉換為 bool 值</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">bool</span>
		<span class="method-name">
			getBoolean
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$default</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$key</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$default</span><span class="var-description">: 找不到對應的選項時所要回傳的值</span>			</li>
				</ul>
		
			
	</div>
<a name="methodparseArgs" id="parseArgs"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method parseArgs</span> (line <span class="line-number">72</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">轉換命令列參數</p>
<p class="description"><p>This command line option parser supports any combination of three types  of options (switches, flags and arguments) and returns a simple array.</p><p>本方法可以將命令列參數轉換為陣列，參考範例如下：</p><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-var">$args&nbsp;</span>=&nbsp;<span class="src-id"><a href="../GoEz/GoEz_Cli.html">GoEz_Cli</a></span><span class="src-sym">::</span><a href="../GoEz/GoEz_Cli.html#methodparseArgs">parseArgs</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'argv'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">[</span><span class="src-id">pfisher&nbsp;</span>~<span class="src-sym">]</span>$&nbsp;<span class="src-id">php&nbsp;test</span>.<span class="src-id">php&nbsp;</span>--<span class="src-id">foo&nbsp;</span>--<span class="src-id">bar</span>=<span class="src-id">baz</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;foo&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;bar&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;baz&quot;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">[</span><span class="src-id">pfisher&nbsp;</span>~<span class="src-sym">]</span>$&nbsp;<span class="src-id">php&nbsp;test</span>.<span class="src-id">php&nbsp;</span>-<span class="src-id">abc</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;a&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;b&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;c&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">[</span><span class="src-id">pfisher&nbsp;</span>~<span class="src-sym">]</span>$&nbsp;<span class="src-id">php&nbsp;test</span>.<span class="src-id">php&nbsp;arg1&nbsp;arg2&nbsp;arg3</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;arg1&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;arg2&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;arg3&quot;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">[</span><span class="src-id">pfisher&nbsp;</span>~<span class="src-sym">]</span>$&nbsp;<span class="src-id">php&nbsp;test</span>.<span class="src-id">php&nbsp;plain</span>-<span class="src-id">arg&nbsp;</span>--<span class="src-id">foo&nbsp;</span>--<span class="src-id">bar</span>=<span class="src-id">baz&nbsp;</span>--<span class="src-id">funny</span>=<span class="src-str">&quot;spam=eggs&quot;&nbsp;</span>--<span class="src-id">also</span>-<span class="src-id">funny</span>=<span class="src-id">spam</span>=<span class="src-id">eggs&nbsp;</span></div></li>
<li><div class="src-line">&nbsp;&gt;&nbsp;<span class="src-str">'plain&nbsp;arg&nbsp;2'&nbsp;</span>-<span class="src-id">abc&nbsp;</span>-<span class="src-id">k</span>=<span class="src-id">value&nbsp;</span><span class="src-str">&quot;plain&nbsp;arg&nbsp;3&quot;&nbsp;</span>--<span class="src-id">s</span>=<span class="src-str">&quot;original&quot;&nbsp;</span>--<span class="src-id">s</span>=<span class="src-str">'overwrite'&nbsp;</span>--<span class="src-id">s</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;plain-arg&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;foo&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;bar&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;baz&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;funny&quot;</span><span class="src-sym">]&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;spam=eggs&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;also-funny&quot;</span><span class="src-sym">]&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;spam=eggs&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;plain&nbsp;arg&nbsp;2&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;a&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;b&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;c&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;k&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;value&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;plain&nbsp;arg&nbsp;3&quot;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">[</span><span class="src-str">&quot;s&quot;</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>=&gt;&nbsp;<span class="src-str">&quot;overwrite&quot;</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">void</span>
		<span class="method-name">
			parseArgs
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$argv</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$argv</span>			</li>
				</ul>
		
			
	</div>

						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Mon, 04 Jan 2010 10:48:52 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>